package com.gmono;

import com.gmono.managers.Comment;
import com.gmono.managers.Common;
import org.json.JSONObject;

import java.sql.SQLException;
import java.util.ArrayList;

public class Test {
    public static void main(String[] a)
    {
        int id= 1;
        ArrayList<Comment> comments=new ArrayList<>();
        try {
            comments= Common.ResultToCollection(Common.Query("select * from comment where id=?",id), row->Comment.getObject(Comment.class,row));
        } catch (SQLException e) {
            e.printStackTrace();
        }
        Comment tc=comments.get(0);
        JSONObject object=new JSONObject(tc);
        System.out.print(object.toString());
    }

}
